package org.deng.learn.webflux.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

/**
 * @author 邓力宾
 * @date 2020/12/18 15:23
 * @desc mongodb实体
 */
@Data
@Document("user")
public class User {
    @Id
    private String id;

    @NotBlank //非空
    private String name;
    @Min(10)@Max(100)
    private Integer age;
}
